package com.neusoft.databus.core.vo;

import com.excel.poi.annotation.ExportField;
import com.excel.poi.annotation.ImportField;

import lombok.Getter;
import lombok.Setter;

/**
 * 指标导入导出VO
 *
 * @author naxiang
 */
@Getter
@Setter
public class MetricPortVO {
    /**
     * 指标组名称
     */
    @ExportField(columnName = "指标组名称")
    @ImportField(required = false)
    private String metricGroupName;
    /**
     * 协议类型
     */
    @ExportField(columnName = "协议类型")
    @ImportField(required = false)
    private String protocol;
    /**
     * 指标组拓展配置
     */
    @ExportField(columnName = "指标组拓展配置")
    @ImportField(required = false)
    private String metricGroupConfig;

    /**
     * 指标名称
     */
    @ExportField(columnName = "指标名称")
    @ImportField(required = true)
    private String name;

    /**
     * 指标标识符
     */
    @ExportField(columnName = "指标标识符")
    @ImportField(required = true, regex = "^[A-Za-z0-9_]{1,100}$")
    private String variable;

    /**
     * 指标值数据类型
     */
    @ExportField(columnName = "指标值数据类型")
    @ImportField(required = true)
    private String valueType;
    /**
     * 为获取指标值而发送的特定协议命令 <br>
     * 如：Modbus-RTU：0300000002 <br>
     * 如：Modbus-ASCII：000000 <br>
     * 如：Modbus-TCP：？？？？ <br>
     */
    @ExportField(columnName = "指标采集指令")
    @ImportField(required = true)
    private String command;
    /**
     * 指标表达式
     */
    @ExportField(columnName = "指标表达式")
    @ImportField(required = false)
    private String expression;
    /**
     * 指标数据起始字节
     */
    @ExportField(columnName = "截取开始字节")
    @ImportField(required = false, regex = "^\\d*$", regexMessage = "截取开始字节必须为数字")
    private Integer start;
    /**
     * 指标数据长度
     */
    @ExportField(columnName = "截取字节数")
    @ImportField(required = false, regex = "^\\d*$", regexMessage = "截取字节数必须为数字")
    private Integer length;
    /**
     * 指标按位取起始位数
     */
    @ExportField(columnName = "截取开始位数")
    @ImportField(required = false, regex = "^\\d*$", regexMessage = "截取开始位数必须为数字")
    private Integer bitStart;
    /**
     * 指标按位取数据长度
     */
    @ExportField(columnName = "截取位数")
    @ImportField(required = false, regex = "^\\d*$", regexMessage = "截取位数必须为数字")
    private Integer bitLength;
    /**
     * 指标数据精度
     */
    @ExportField(columnName = "数值精度")
    @ImportField(required = false, regex = "^\\d*$", regexMessage = "数值精度必须为数字")
    private Integer precisionBits;
    /**
     * 指标单位
     */
    @ExportField(columnName = "指标单位")
    @ImportField(required = false)
    private String unit;

}
